﻿@model AppManager.Model.App
@{
    Layout = null;
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2, minimum-scale=1, user-scalable=yes" />
    <title>@Model.Name-App下载</title>
    <link href="~/css/basic.css" rel="stylesheet" type="text/css" />
    <link href="~/css/css.css" rel="stylesheet" type="text/css" />
    <script src="~/Scripts/jquery-1.10.2.min.js"></script>
</head>

<body>
    <div class="app_detail">
        <!--頭部標題-->
        <div class="app_detail_top">
            <span class="left">@Model.Name</span>
            <p style="display:none" id="androidDetail" class="right">版本：@Model.AndroidInfo.Version / 大小：@Model.AndroidInfo.Size / @Model.AndroidInfo.PushDate.ToStr()</p>
            <p style="display:none" id="iosDetail" class="right">版本：@Model.IosInfo.Version / 大小：@Model.IosInfo.Size / @Model.IosInfo.PushDate.ToStr()</p>
            <div class="clearfix"></div>
        </div>

        <!--內容-S-->
        <div class="app_detail_con1">
            <dl>
                <dd class="img"><img style="width:120px;height:120px;" src="@GetImage(Model.LogoUrl)"></dd>
                <dd class="menu1">
                    <button class="btn btn-red" id="download">
                        <img src="~/images/xz_ico.png" class="app_xz_ico">點擊安裝
                    </button>
                </dd>
            </dl>
        </div>
        <div class="clearfix"></div>
        <div class="app_detail_con2">
            <dl>
                @*@Url.Action("Index", "Home", new { Id = Model.Id }, "http")*@
                @{
                    var url = Url.Action("Index", "Home", new { Id = Model.Id }, "http");
                }
                <dt>或用手機掃描下面的二維碼安裝</dt>
                <dd><img src="@Url.Action("QrCode", "Home", new { url = url })"></dd>
            </dl>
        </div>
        <!--內容-E-->
        @*<!--底部-S-->
        <div class="clearfix"></div>
        <div class="app_detail_bottom">
            <p>深圳市愛普訊息科技有限公司</p>
        </div>
        <!--底部-S-->*@
    </div>
</body>
</html>

<script>
    $(function () {
        iosUrl = "@(Model.IosInfo?.Url)";
        androidUrl = "@(Model.AndroidInfo?.Url)";
        url = "";
        judgeDevice();
        //location.href = url;

        $('#download').on('click', function () {
            location.href = url;
        })

        //setTimeout(function () {
        //    location.href = url;
        //}, 3000)
    });

    function judgeDevice() {
        if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
            url = iosUrl;
            $('#androidDetail').hide();
            $('#iosDetail').show();
        }
        else if (navigator.userAgent.match(/android/i)) {
            url = androidUrl;
            $('#androidDetail').show();
            $('#iosDetail').hide();
        }
        else {
            url = iosUrl;
            $('#androidDetail').hide();
            $('#iosDetail').show();
        }
    }
</script>